import React, { Component } from 'react'
import { observer } from 'mobx-react/custom'
import { Button } from 'antd-mobile'
import PromptVM from 'cvm/prompt/prompt'
import './prompt.less'

const PromptList = observer(({ vm }) => {
  console.log(vm.tipsState)
  return (
    <div>
      <div className='right-tip'>
        <img src={require('../../images/success.png')} />
      </div>
      {
        vm.tipsState === 'submit' ? <div>
          <p className='submit-sucess'>提交成功</p>
          <p className='tips'>等待平台确认，销售金额实际情况为准</p>
        </div>
          : <div>
            <p className='submit-sucess'>保存成功</p>
          </div>
      }
      <div className='btn-box'>
        <Button type='primary' onClick={() => vm.handleAddProject()}>继续添加项目</Button>
        <Button onClick={() => vm.handleBackProject()}>返回项目列表</Button>
      </div>
    </div>
  )
})

@observer
class prompt extends Component {
  constructor (props) {
    super(props)
    window.document.title = '提示页'
    this.vm = new PromptVM(props)
  }
  render () {
    return (
      <div>
        <PromptList vm={this.vm} />
      </div>
    )
  }
}

export default prompt
